<template>
  <div class="Son">孙组件
    ---{{name}}---{{price}}---
  </div>
  
</template>

<script>
import {inject,toRefs} from 'vue'
export default {
    name:'Son',
    setup(){
        let car = inject('car');

        return {
            ...toRefs(car)
        }
    }
}
</script>

<style>
    .Son{
        background-color: lightcoral;
        padding: 10px;
    }
</style>